package com.zyong.design.pattern.command.case2;

/**
 * @program: zyong-design-pattern
 * @ClassName: WashingMachineOnCommand
 * @author: zyong
 * @create: 2024-03-27 22:10
 */
public class WashingMachineOnCommand implements Command {
    private WashingMachineReceiver washingMachineReceiver;

    public WashingMachineOnCommand(WashingMachineReceiver washingMachineReceiver) {
        this.washingMachineReceiver = washingMachineReceiver;
    }

    @Override
    public void execute() {
        washingMachineReceiver.on();
    }

    @Override
    public void undo() {
        washingMachineReceiver.off();
    }
}
